<template>
	
	<view class="asset">
		<view class="head" style="z-index: 999;">
			<view class="head_text" @click="blacks()">继续投资</view>
			<image src="../../../static/public/img/fh.png"
				style="width: 18px;height: 18px;position: absolute;top:33px;left: 15px;"></image>
				<view class="ss">投资列表</view>
		</view>
		 
			
			
			<view style="margin-top: 3%;">
				<view style="width:95%;height: 65px;background-color:white;padding-bottom: 3%;margin-left: 2.5%;    border: 1px solid #d7d7d7;" v-for="(item,index) in data">
					<view style="width: 70%;color: #cd0006;font-size: 14px;float: left;padding-left: 3%;padding-top: 3%;font-weight: 600;">{{item.name}}</view>
					<view style="width: 20%;color:red;font-size: 14px;float: left;padding-left: 3%;padding-top: 3%;"><image @click="dels(index)" src="../../../static/public/img/cuowu.png"
					style="width: 25px;height: 25px;top:18px;left: 30px;" ></image></view>
					
					<view style="width: 100%;color: #818181;font-size: 12px;float: left;padding-left: 3%;padding-top: 3%;">
						<text >一笔{{item.unit}}元</text>
					</view>
				</view>
			</view>
			
			<!-- <view v-if="isgd" style="background: red;width:100%;height: 100%;z-index: 9999;position: absolute;top: 0;opacity: 0.0;" @click="gds(isgd)"></view> -->
			<view style="bottom: 0;left: 0;right: 0;width: 100%;height: 50px;position: fixed;background-color: #666;">
				<view style="width:15%;height: 50px;float: left;text-align: center;border-right: 1px solid #7f7b7b;" @click="deles()">
					<image src="../../../static/public/img/shanchu.png" style="width: 18px;height: 18px;vertical-align: middle;top:28%"></image>
				</view>
				
				<view style="width:60%;height: 50px;float: left;text-align: center;border-right: 1px solid #7f7b7b;line-height: 50px;font-size: 15px;font-weight: 700;">
					<text style="color: #fff;">共</text><text style="color: #f90;">{{data.length}}</text><text style="color: #fff;">笔</text><text style="color: #f90;">{{unit*data.length}}</text><text style="color: #fff;">元</text>
				</view>
				
				<view style="width:24.5%;height: 50px;float: left;text-align: center;line-height: 50px;font-size: 15px;background-image: linear-gradient(180deg,#e6b87a,#d49a53 80%);" @click="create()">
					投资
				</view>
			</view>
	

	</view>
</template>

<script>
	//导入组件
	export default {
		data() {
			return {
              issx:false,
			  isgd:true,
			  data:[],
			  unit:0,
			}
		},
		methods: {
			   sx(e){
			   	if(e==false){
			   		this.issx=true;
			   	}else{
			   		this.issx=false;
			   	}
			   },
			   sxselected(){
				   this.issx=false;
			   },
			   blacks(){
				   	// uni.navigateBack({
				   	// 	delta:1,//返回层数，2则上上页
				   	// })
					uni.navigateTo({
						url:'/pages/components/gameCenter/gameCenterfire'
					})
			   },
			   gobetDetail(){
				   uni.navigateTo({
				   	url:'/pages/components/betDetail/betDetail'
				   })
			   },
			   dels(index){
				   this.data.splice(index,1);
				   uni.setStorageSync('shoplx',this.data);
			   },
			   gds(){
				   
			   },
			   deles(){
				   this.data = []
				   uni.setStorageSync('shoplx','')
			   }
		},
		onShow() { 

		},
		
		onLoad() {
			this.data = uni.getStorageSync('shoplx')
			this.data.forEach((item,i) => {
				this.unit += item.unit
			})
		}

	}
</script>

<style lang="scss">
	page {
		background-color: #f2f2f2;
	}

	.asset {
	   .head {
	   	background: #151516 !important;
	   	color: #fff;
	   	height: 130rpx;
	   	font-size: 18px;
	   }
	   
	   .head_text {
		 font-size: 14px;
         margin-left: 9%;
	   	 line-height: 160rpx;
	   }
	   .item{
		   width: 100%;
		   float: left;
		   margin-top: 5%;
		   border-bottom: 1px solid #ddd;
		   padding-bottom: 3%;
	   }
	   .sx{
		   width:25%;
		   height: 30px;
		   border:1px solid #d7d7d7;
		   text-align: center;
		   border-radius: 5px;
		   line-height: 30px;
		   background: #fff;
		   margin-left: 5%;
		   float: left;
		   margin-top:3%;
	   }
	   .sxs{
	   		   width:25%;
	   		   height: 30px;
	   		   border:1px solid #cd0006;
	   		   text-align: center;
	   		   border-radius: 5px;
	   		   line-height: 30px;
	   		   background: #fff;
	   		   margin-left: 5%;
	   		   float: left;
	   		   margin-top:3%;
			   color:#cd0006;
			   background: url(../../../static/public/img/xz.png) no-repeat 50% 50%;
			   background-size: 30px;
			   background-position-x: 71px;
			   background-position-y: 5px;
	   }
	   .ss {
	   		 text-align: center;
	   		 line-height: 160rpx;
	   		 position: absolute;
	   		 top: 0px;
	   		 left: 42%;
	   }

	}
</style>
